#ifndef _READ_FILE_H_
#define _READ_FILE_H_

#include "main.h"

typedef struct {
	char mail[255];
	char server[255];
	char port[10];
	char http_status[4];
	char state; /* is alive */
	unsigned int no;
}site_block;

typedef struct {
	site_block sites[MAX_CHECK_LINES];
	unsigned int block_num; /* real block number */
}block_item;

typedef struct {
	char *file_name;
	void (*p_handle_site)(site_block *); /* callback */
}file;

typedef struct {
	file *p_file;
	FILE *fp;
}site_handle;

void parse_file(file *p_file);
void save_state(float f);
static void handle_file(site_handle *p_handle);
#endif
